home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d13 / q_aparad.arc / QUERY.QA < prev    next >
Encoding:
Text File  |  1991-03-13  |  7.1 KB  |  265 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.               PARADOX COMMON QUESTIONS AND ANSWERS
  8.  
  9. QUERY
  10.  
  11.    1.  Can you alternate order between different tables in ASK?
  12.  
  13.        No, Paradox creates the fields  in the answer table in the
  14.        same order as they appear in the query.  One way of having
  15.        fields that alternate from different tables is  to perform
  16.        the first  query and then, assuming the default setting is
  17.        IMAGEORDER, change the order of the ANSWER table fields to
  18.        the  order  you  wish  and  then check all the fields  and
  19.        process the query.  Voila!
  20.  
  21.  
  22.    2.  During an outer join, can I use more than 2 tables?
  23.  
  24.        If you are trying to do an outer join  using  one  example
  25.        element  through more than two tables,  you  will  get  an
  26.        error message.  The alternate  method  to  get  around the
  27.        error is to actually define  a  different  set  of example
  28.        elements between  a previously used table and a table that
  29.        has no example element as yet.  For example:
  30.  
  31.        TABLE1 ---  _a     TABLE2 ---  _a!,_b    TABLE3 ---  _b
  32.  
  33.  
  34.    3.  How  do  I  find  all  the  records  associated  with  one
  35.        particular month?
  36.  
  37.        The simplest way to extract all the dates for one month is
  38.        to  fill in the day area  with  wildcard  characters  (ie.
  39.        4/../89).    This  also works to extract all records for a
  40.        particular month in all years (ie.  4/../..).
  41.  
  42.  
  43.    4.  How can I add particular  fields from one table to another
  44.        table?
  45.  
  46.        By  placing example elements in both  the  fields  in  the
  47.        source table as well as the fields in the target table and
  48.        then placing the INSERT statement in the  leftmost column,
  49.        Paradox will insert the  values  from  the source table as
  50.        new  values  in  the target table.  By removing the INSERT
  51.        command  and  adding  the  CHANGETO  command  before  each
  52.        example  element, Paradox will change the existing  record
  53.        values to those of the source table.
  54.  
  55.  
  56.    5.  How do I add days to an  existing  date  so  I  can  see a
  57.        future date?
  58.  
  59.        Example - place  the  following  in  the  appropriate DATE
  60.        field:
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.        check,_a,calc _a + xx         where  xx is the future # of
  74.        days.
  75.  
  76.  
  77.    6.  I  cannot  seem  to  concatenate  my city, state  and  zip
  78.        together without excess spaces.
  79.  
  80.        Place example elements in each of the corresponding fields
  81.        and then use a concatenating  expression  with  spaces and
  82.        commas added within double quotes.
  83.  
  84.  
  85.    7.  How can I find fields with duplicate values?
  86.  
  87.        Check the fields in which  you want to look for duplicates
  88.        and use the qualifier count > 1 in a unique field.
  89.  
  90.  
  91.    8.  Does it make any difference if the order of the  tables on
  92.        the workspace is not the same as the defined order?
  93.  
  94.        Depending upon the  setting  in the CCP under DEFAULTS, if
  95.        the setting is in TABLEORDER then no matter how the fields
  96.        are moved in the  query  the  answer  will remain in table
  97.        order.  If the  setting  in CCP is to IMAGEORDER, then the
  98.        order of the fields in a query decides the order  in which
  99.        the fields will be  sorted,  and  the  order in which they
  100.        will appear in the answer table.
  101.  
  102.  
  103.    9.  How can I include the average of a group  based  upon  the
  104.        overall total within a report?
  105.  
  106.        By  calculating  the  total  of  the  particular  field in
  107.        question in a query outside of the report and then placing
  108.        a keyed dummy field in  the resulting ANSWER table as well
  109.        as a dummy  field  in  the  original table, the sum can be
  110.        linked into each record of the original inside the report.
  111.        By dummy field, I am referring to a short (A1)  field that
  112.        contains nothing but blanks.
  113.  
  114.  
  115.   10.  How do I set the crosstab for a graph?
  116.  
  117.        The  simplest way to accomplish this  feat  is  to  select
  118.        <I>mage,  <G>raphs,  <C>rosstabs.  Then,  select  the  row
  119.        labels  that you want to use, the  field  for  the  column
  120.        labels, and,  finally, select the values to be placed onto
  121.        the graph.
  122.  
  123.  
  124.   11.  How do I add  a  specific character to the beginning of my
  125.        text field?
  126.  
  127.  
  128.  
  129.  
  130.                               - 2 -
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.        Go to the field you wish to change and  place  an  example
  140.        element,  then  a   comma,  then  the  CHANGETO  statement
  141.        followed by the character within double quotes, and then a
  142.        plus sign followed by the example element.
  143.  
  144.  
  145.   12.  How can I find and replace values within certain records?
  146.  
  147.        Place the values to select upon in the  proper  fields and
  148.        then issue the CHANGETO command  in the fields you wish to
  149.        change.
  150.  
  151.  
  152.   13.  How do I delete records with specific values?
  153.  
  154.        Place the delete statement  in  the  leftmost field of the
  155.        query, then place the values upon which to select in their
  156.        respective fields.
  157.  
  158.  
  159.   14.  How do I split a large table into several smaller ones?
  160.  
  161.        After making sure that  you  have  a common field checked,
  162.        simply check the fields you want to appear  in  a specific
  163.        table. Repeat the process for any other segments.
  164.  
  165.  
  166.   15.  I use the QuerySave, now how do I play it?
  167.  
  168.        After selecting <S>cript, <P>lay, <S>criptname, when query
  169.        appears on the workspace, press <F2>, Do_It!
  170.  
  171.  
  172.   16.  How  do  I  calculate the sum of all my records, including
  173.        duplicates?
  174.  
  175.        By using the calc sum  all statement, the sum includes the
  176.        duplicates.
  177.  
  178.  
  179.   17.  When  running  a  query on a relatively small table, I run
  180.        out  of  disk  space, when there should be more than three
  181.        times the amount of space used by the  table  available on
  182.        my hard disk.
  183.  
  184.        In  cases  where  a  query  takes more disk space than  it
  185.        should, the most common problem is a corrupt  table.   Run
  186.        TUTILITY on the table.
  187.  
  188.  
  189.   18.  How do I use a tilde variable?
  190.  
  191.        Simply create a query with  a variable name in the desired
  192.        field, but make sure the  variable is preceded by a tilde.
  193.  
  194.  
  195.  
  196.                               - 3 -
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.        You can then save the query as a script  and  precede  the
  206.        playing of the script with prompt and accept statements to
  207.        supply a value to the variable.
  208.  
  209.  
  210.   19.  How do I get my find queries to run faster?
  211.  
  212.        Paradox will  actually  place  its  own  QuerySpeedups  on
  213.        fields it  decides  will  benefit  by  a  secondary index.
  214.        However,  you  can  place  secondary  indices  on  a table
  215.        through the <T>ools, <Q>uerySpeedup  options  or  by using
  216.        the INDEX command through a PAL script.
  217.  
  218.  
  219.   20.  Why can't I use a CHANGETO with a DATE field?
  220.  
  221.        The problem is not  that  you cannot use a CHANGETO with a
  222.        DATE field, it is  that  when  you  subtract one date from
  223.        another the outcome is NUMERIC not DATE.
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.                               - 4 -
  263.  
  264.  
  265.